<template>
  <div class="ban-box">
    <van-swipe :autoplay="3000" style="height:150px">
      <van-swipe-item v-for="(image, index) in images" :key="index" >
        <img v-lazy="image" width="100%"/>
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import Vue from "vue";
import { Lazyload } from "vant";
Vue.use(Lazyload);
import axios from "axios";
export default {
  name: "ban",
  data() {
    return {
      images: [],
    };
  },
  created() {
    axios({
      url: "/banJifen",
      method: "get",
    }).then((res) => {
      this.images = res.data;
      console.log(res.data);
    });
  },
};
</script>
<style>
.ban-box {
  width: 100%;
}
</style>
